package com.member.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.member.dao.MemberDao;
import com.member.domain.MemberCommand;

@Controller
public class MyInfoPageController {

	@Autowired
	private MemberDao memberDao;
	
	@RequestMapping("/shop/myInfo.do")
	public ModelAndView process(HttpSession session){
		
		String userId = (String)session.getAttribute("userId");
		
		MemberCommand member = memberDao.selectMyInfo(userId);
		
		ModelAndView mav = new ModelAndView();
		
		mav.setViewName("myInfoPage");
		
		mav.addObject("member", member);
		
		return mav;
	}
	
}
